import type { IdentityUserDto } from '@/utils/api/user/type';
export const setUser = (user: IdentityUserDto): void => {
  const userJsonStr: string = JSON.stringify(user);
  sessionStorage.setItem('user', userJsonStr);
};
export const getUser = (): IdentityUserDto | null => {
  const userJsonStr: string | null = sessionStorage.getItem('user');
  if (userJsonStr === null) {
    return null;
  }
  return JSON.parse(userJsonStr) as IdentityUserDto;
};
export const removeUser = (): void => {
  sessionStorage.removeItem('user');
};
